package com.ux.example
{
	import com.ux.effect.Snow;
	import com.ux.manager.StageManager;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.events.MouseEvent;
	
	public class SnowEffectTest extends Sprite
	{
		private var _snow : Snow;
		public var weatherClip : MovieClip;
		private var isPlay : Boolean = false;
		
		public function SnowEffectTest()
		{
			super();
			
			stage.align = StageAlign.TOP_LEFT;
//			stage.scaleMode = StageScaleMode.NO_SCALE;
			StageManager.stage = stage;
			_snow = new Snow( weatherClip.width, weatherClip.height );
			weatherClip.addChild( _snow );
			stage.addEventListener( MouseEvent.CLICK, onClick );
		}

		private function onClick( e:MouseEvent ):void 
		{
			if( isPlay ) 
			{
				isPlay = false;
				_snow.stop();
			}
			else
			{
				isPlay = true;
				_snow.play();
			}
		}
	}
}